package com.chrray.position.enums.app;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * 学历:1.初中及以下，2.高中，3.大专，4.本科，5.硕士，6博士及以上
 */
public enum FdEduLevelEnum implements BaseEnum{
    PRIMARY_SCHOOL(1, "初中及以下"),
    HIGH_SCHOOL(2, "高中"),
    JUNIOR_COLLEGE(3, "大专"),
    UNDERGRADUATE(4, "本科"),
    MASTER(5, "硕士"),
    DOCTOR(6, "博士及以上")
    ;

    @JsonValue
    @EnumValue
    private final Integer value;
    private final String info;

    FdEduLevelEnum(Integer value, String info) {
        this.info = info;
        this.value = value;
    }

    @JsonCreator
    public static FdEduLevelEnum getByValue(Integer value) {
        for (FdEduLevelEnum en : FdEduLevelEnum.values()) {
            if (en.getValue().equals(value)) {
                return en;
            }
        }
        return null;
    }

    public Integer getValue() {
        return value;
    }

    public String getInfo() {
        return info;
    }
}
